/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#include "ManagerSimple.h"
#include "File.h"
#include "NetFile.h"
//#include "ResourceFileWindowsMulti.h"
//#include <logs/Log.h>

namespace liba
{
namespace resource
{

ManagerSimple::ManagerSimple( const filesystem::String & archive_name )
{
//	ResourceFileWindowsMulti::create( archive_name );
}

ManagerSimple::~ManagerSimple()
{
//	ResourceFileWindowsMulti::destroy();
}

Resource * ManagerSimple::create_resource_internal(const filesystem::String & name)const
{
///	Log::log() << "ResourceManager::create_resource " << name << "\n";
	//ResourceFileWindowsMulti * frm = new ResourceFileWindowsMulti( name );
	//if( !!*frm )
	//	return frm;
	//delete frm; frm = 0;
#ifdef NETFILESYSTEM_URL
	// try network filesystem first
	NetFile * frwn = new NetFile( name );
	if( frwn->is_valid() )
		return frwn;
	delete frwn; frwn = 0;
#endif
	File * frw = new File( name );
	if( !!*frw )
		return frw;
	delete frw; frw = 0;

	return 0;
}

} // namespace resource
} // namespace liba

